package com.jiao.databinding3.collection;

import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableArrayMap;
import androidx.databinding.ObservableList;
import androidx.databinding.ObservableMap;

import com.jiao.databinding3.R;
import com.jiao.databinding3.databinding.ActivityMain2Binding;
import com.jiao.databinding3.databinding.ActivityMain3Binding;
import com.jiao.databinding3.observablefield.ObservableGoods;

import java.util.Random;

public class MainActivity3 extends AppCompatActivity {
    private ObservableMap<String, String> map;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);
//        ActivityMain3Binding activityMain12Binding = DataBindingUtil.setContentView(this, R.layout.activity_main3);
//        map = new ObservableArrayMap<>();
//        map.put("name", "leavesC");
//        map.put("age", "24");
//        activityMain12Binding.setMap(map);
//        ObservableList<String> list = new ObservableArrayList<>();
//        list.add("Ye");
//        list.add("leavesC");
//        activityMain12Binding.setList(list);
//        activityMain12Binding.setIndex(0);
//        activityMain12Binding.setKey("name");
    }

    public void onClick(View view) {
        map.put("name", "leavesC,hi" + new Random().nextInt(100));
    }
}
